package cn.kgc.ubagnet.service.order;

import cn.kgc.ubagnet.mapper.OrderdetailsMapper;
import cn.kgc.ubagnet.pojo.Orderdetails;
import cn.kgc.ubagnet.pojo.Orderdetails;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderDetailsServiceImpl implements OrderDetailsService{
    @Resource
    OrderdetailsMapper odmapper;

    //添加详细信息
    @Override
    public int Add_OD(Orderdetails orderDetails) {
        int r=odmapper.insertSelective(orderDetails);
        if(r>0) return 1;
        return 0;
    }

    //查询
    @Override
    public Orderdetails Query_OD(Long detailsid) {
        return odmapper.selectByPrimaryKey(detailsid);
    }

    //修改
    @Override
    public int Update_OD(Orderdetails orderDetails) {
        int r=odmapper.updateByPrimaryKeySelective(orderDetails);
        if(r>0) return 1;
        return 0;
    }

}
